﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CP.Entities;
using CP.Repositories.GPM;
using CP.Utility;
using CP.DBService;

namespace CP.Controllers.GPM
{
    public class UserConfigController
    {
        public void ChangePassword(string userid, string oldpassword, string newpassword)
        {
            UserInfoRepository rep = new UserInfoRepository();
            User_Info user = rep.GetUserByID(userid);
            if (EncryptHelper.MD5(oldpassword) != user.password)
                throw new Exception("旧密码不正确，请重新输入");
            rep.ChangePassword(userid, newpassword);
        }
    }
}
